<?php
declare (strict_types = 1);

namespace app\common\validate;

use think\Validate;
class FinanceAssets extends Validate
{
    protected $rule = ['assets_type' => 'require','assets_name' => 'require','assets_unit' => 'require','assets_price' => 'require','assets_supplier' => 'require','assets_num' => 'require',
    ];

    protected $message = ['assets_type.require' => '1=固定资产,2=易耗品为必填项','assets_type.number' => '1=固定资产,2=易耗品需为数字','assets_name.require' => '资产名称为必填项','assets_unit.require' => '资产单位为必填项','assets_price.require' => '资产单价为必填项','assets_price.number' => '资产单价需为数字','assets_supplier.require' => '供应商为必填项','assets_num.require' => '数量为必填项','assets_num.number' => '数量需为数字',
    ];

    /**
     * 添加
     */
    public function sceneAdd()
    {
        return $this->only(['assets_type','assets_name','assets_unit','assets_price','assets_supplier','assets_num',]);
    }

    /**
     * 编辑
     */
    public function sceneEdit()
    {
        return $this->only(['assets_type','assets_name','assets_unit','assets_price','assets_supplier','assets_num',]);
    }
}
